1. Field of the Invention
The present invention relates to an electronic circuit, and particularly, to a circuit for providing hysteresis in a differential input comparator.
2. Description of the Related Art
A typical comparator is provided with two input terminals for comparing an input voltage signal and a reference voltage signal respectively received at the two input terminals, amplifying the voltage difference between the two signals and then producing an output signal with a logic high voltage or a logic low voltage based on the voltage difference. Generally, a logic high signal is produced at the output of the comparator when the input voltage is higher than the reference voltage. On the other hand, a logic low signal is produced at the output of the comparator when the input voltage is lower than the reference voltage.
In order to prevent erroneous changes in the output voltage of the comparator resulting from noises in the input voltage signal or in the reference voltage signal, a typical solution to provide a hysteresis circuit in the comparator, so that a threshold voltage at which the output voltage of the comparator changes from logic low to logic high is different from a threshold voltage at which the output voltage of the comparator changes from logic high to logic low. FIG. 1 is a graph showing the relation between the input voltage signal and the output voltage signal of a comparator with a hysteresis characteristic, in which the horizontal axis represents the input voltage signal Vin while the vertical axis represents the output voltage signal Vout. When the output voltage signal Vout is in a logic low state, the input voltage signal Vin must rise above an upper threshold voltage Vth so that the output voltage signal Vout will change from logic low to logic high. When the output voltage signal Vout is in a logic high state, the input voltage signal Vin must fall below a lower threshold voltage Vtl so that the output voltage signal Vout will change from logic high to logic low. The voltage difference between the upper threshold voltage Vth and the lower threshold voltage Vtl is referred to as a hysteresis width, which is usually designed to be several hundreds of Millivolts.
R.O.C. Patent Publication No. 508567, titled “Hysteresis comparing device with constant hysteresis width” discloses a comparator circuit having a hysteresis characteristic. FIG. 2 illustrates a schematic circuit diagram of the hysteresis comparing device disclosed in the above patent. As shown in FIG. 2, the hysteresis comparing device 20 comprises a threshold voltage generator 22, a selection switching device 24 and a comparator 26. The hysteresis comparing device 20 receives an input voltage signal Vin and produces an output voltage signal Vout. The threshold voltage generator 22 generates an upper threshold voltage Vth and a lower threshold voltage Vtl from a DC voltage signal Vdc according to a desired hysteresis width. The selection switching device 24 includes a first switch 24a and a second switch 24b, which are controlled on the basis of the output voltage signal Vout of the comparator 26 to select one of the upper threshold voltage Vth and the lower threshold voltage Vtl as a reference voltage signal of the comparator. When the output voltage signal Vout is in a logic low state, the switch 24a is turned ON while the switch 24b is turned OFF, and thus the upper threshold voltage Vth is output from the selection switching device 24. On the other hand, when the output voltage signal Vout is in a logic high state, the switch 24a is turned OFF while the switch 24b is turned ON, and thus the lower threshold voltage Vtl is output from the selection switching device 24. According to the above design, when the output voltage signal Vout is in a logic low state, the input voltage signal Vin must rise above the upper threshold voltage Vth so that the output voltage signal Vout will change from logic low to logic high; when the output voltage signal Vout is in a logic high state, the input voltage signal Vin must fall below the lower threshold voltage Vtl so that the output voltage signal Vout will change from logic high to logic low. Thereby, the hysteresis effect is achieved.
However, the prior art circuit in FIG. 2 is designed by providing an external threshold voltage generating circuit to a comparator to thereby obtain a hysteresis effect, which is disadvantageous because of its slow switching rate and the complicated circuit components. Such a comparing device is impossible to be designed into an integrated circuit. Therefore, it is desired to develop comparator hysteresis circuit, which is fast in switching rate, simple in circuit structure and suitable for application in an integrated circuit.